package com.endurance;

import com.endurance.factory.PaymentFactory;
import com.endurance.service.PaymentService;
import com.endurance.service.impl.AliPayService;
import com.endurance.service.impl.WxPayService;

/**
 * @Author: sunlin
 * @Date: 2024-05-06 8:44
 * @Version: 1.0
 * @Description:
 */
public class Test {

    public static void main(String[] args) {
        PaymentService ali = new AliPayService();
        PaymentService wx = new WxPayService();
        ali.pay();
        wx.pay();

        PaymentFactory.getPaymentService("ALI").pay();
        PaymentFactory.getPaymentService("WX").pay();

        PaymentFactory.getPaymentService("ALI").pay();
        PaymentFactory.getPaymentService("WX").pay();
    }

}
